/*-
 * Copyright (c) 2009-2013 Shang-Rong Cai. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $ BASE: bscdef.h    Rev. 1.2.0    2013-09-23T11:18+08:00 $
 */

#ifndef BSCDEF_H
#define BSCDEF_H

#include <stdint.h>


/* Switchable Index Variable Type Definition */
#ifdef INDEX_64
typedef int64_t sidx_t;  /* Signed index type of 64 bits integer */
typedef uint64_t uidx_t;  /* Unsigned index type of 64 bits integer */
#else
typedef int32_t sidx_t;  /* Signed index type of 32 bits integer */
typedef uint32_t uidx_t;  /* Unsigned index type of 32 bits integer */
#endif


/* Indexed Float Point Variable */
/* Single-Precision Floating-Point */
typedef struct
{
    uidx_t index;
    float value;
} fltf_t;

/* Double-Precision Floating-Point */
typedef struct
{
    uidx_t index;
    double value;
} fltd_t;


/* Define Numbering Style */
#define C_STYLE 0  /* C style numbering */
#define N_STYLE 1  /* Natural style numbering */


/* Define Default Cell Type Identifier */
#define CT_UND_CELL 0x00  /* Undefined cell type */
#define CT_UNI_VERT 0x01  /* Unit vertex */
#define CT_MUL_VERT 0x02  /* Multiple vertices */
#define CT_STD_EDGE 0x03  /* Standard edge */
#define CT_STR_EDGE 0x04  /* Strip edge */
#define CT_STD_TRIA 0x05  /* Standard triangle */
#define CT_STR_TRIA 0x06  /* Strip triangle */
#define CT_STD_POLY 0x07  /* Standard polygon */
#define CT_STD_PIXE 0x08  /* Standard pixel */
#define CT_STD_QUAD 0x09  /* Standard quadrilateral */
#define CT_STD_TETR 0x0a  /* Standard tetrahedron */
#define CT_STD_VOXE 0x0b  /* Standard voxel */
#define CT_STD_HEXA 0x0c  /* Standard hexahedron */
#define CT_STD_WEDG 0x0d  /* Standard wedge */
#define CT_STD_PYRA 0x0e  /* Standard pyramid */
#define CT_QDR_EDGE 0x15  /* Quadratic edge */
#define CT_QDR_TRIA 0x16  /* Quadratic triangle */
#define CT_QDR_QUAD 0x17  /* Quadratic quadrilateral */
#define CT_QDR_TETR 0x18  /* Quadratic tetrahedron */
#define CT_QDR_HEXA 0x19  /* Quadratic hexahedron */
#define CT_QDR_WEDG 0x1d  /* Quadratic wedge */
#define CT_QDR_PYRA 0x1e  /* Quadratic pyramid */
#define CT_EXT_TRIA 0x26  /* Extra triangle */
#define CT_EXT_QUAD 0x27  /* Extra quadrilateral */
#define CT_EXT_TETR 0x28  /* Extra tetrahedron */
#define CT_EXT_HEXA 0x29  /* Extra hexahedron */
#define CT_HYB_TYPE 0xff  /* Hybrid type */


/* Cell Variable Type Definition */
typedef int8_t cell_t;  /* Cell type of 8 bits integer */
typedef int8_t face_t;  /* Face type of 8 bits integer */


/* Miscellaneous */
#define DEFAULT_APC 32

#define DEFAULT_PUR 0
#define DEFAULT_TAG 1

#endif
